#ifndef _SCENE_
#define _SCENE_

#include "..\Core\base.h"

#include "hge\hge.h"
#include "hge\hgeresource.h"
#include "hge\hgegui.h"
#include "hge\hgefont.h"

namespace air {
	class SceneManager;
	class NetIO;
	class Acc;

	/**
	 * @brief interface of Scene.
	 */
	class IScene {
	public:
		/**
		 * @brief provide scene with pointer to HGE, hgeGUI and resourceManager which can be used freely by users
		 *
		 * @param _hge
		 * @param _gui
		 * @param _hgeResMan
		 */
		IScene();
		void beforeInitialize(SceneManager*, HGE*, hgeGUI*, hgeResourceManager*, NetIO*, Acc*);
		
		virtual bool initialize() = 0;
		virtual bool update(float dt) = 0;
		virtual bool render(float dt) = 0;
		virtual void release() {}
		/**
		 * @brief 
		 */
		void setSceneEnd() { gui->Leave(); }
		/**
		 * @brief callback called when scene is about to disappear
		 */
		virtual void Leave() { gui->Leave();};
		void leaveCounter();
		/**
		 * @brief callback called when scene is about to appear
		 */
		virtual void Enter() { gui->Enter();}
		virtual ~IScene() {}
	protected:
		int elmtCount;
		int leaveCount;
		SceneManager* sceneManager;
		NetIO* netIO;
		hgeResourceManager* hgeResMan;
		HGE* hge;
		hgeGUI* gui;
		Acc* acc;
		static hgeFont* fnt;
	};
}

#endif
